import React from 'react';

export default class SpreadAttributes extends React.Component {
    // Calls the children callback numTimes to produce a repeated component
    render() {
        const Button = props => {
            const { kind, ...other } = props;
            const className = kind === "primary" ? "PrimaryButton" : "SecondaryButton";
            return <button className={className} {...other} />;
        };

        return (
            <div>
                <Button kind="primary" onClick={() => console.log("clicked!")}>
                    Hello World!
                </Button>
            </div>
        );
    }
}